import 'package:flutter/material.dart';

class BasicDemo extends StatelessWidget {
  final TextStyle _testStyle = TextStyle(fontSize: 16.2);


  @override
  Widget build(BuildContext context) {
    return  Container(
      color: Colors.grey[100],
      child: Row(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Container(
            child: Icon(Icons.pool,size: 32.0,color: Colors.blue,),
            // color: Color.fromRGBO(3, 54, 255, 1.0),
            padding: EdgeInsets.all(16.0),
            margin: EdgeInsets.all(8.0),
            width: 90.0,
            height: 90.0,
            decoration: BoxDecoration(
              color: Color.fromRGBO(3, 54, 255, 1.0),
              border: Border.all(
                  color: Colors.red,
                  width: 3.0,
                  style: BorderStyle.solid
              ),
              // borderRadius: BorderRadius.circular(10.0),
              boxShadow: [//阴影
                BoxShadow(offset: Offset(6.0, 7.0)
                ,color: Color.fromRGBO(16, 20, 188, 1.0),blurRadius: 16.0,
                spreadRadius: -1.0),
              ],
              shape: BoxShape.circle,
            ),
          )
        ],
      ),
    );
  }
}

class RichTextDemo extends StatelessWidget{
  @override
  Widget build(BuildContext context) {
    return RichText(text:TextSpan(
      text: "Mr Chang",
      style: TextStyle(
          color: Colors.black,
          fontSize: 34.0,
          fontStyle: FontStyle.italic,
          fontWeight: FontWeight.w100
      ),
      children: [TextSpan(text: ".net",style: TextStyle(
          color: Colors.blue,
          fontSize: 20.0,
          fontStyle: FontStyle.italic,
          fontWeight: FontWeight.w100
      )),],
    ));
  }

}
class TextDemo extends StatelessWidget {
  final TextStyle _testStyle = TextStyle(fontSize: 16.2);
  final String _author = "李白";
  final String _title = "将进酒";

  @override
  Widget build(BuildContext context) {
    return Text(
      "《$_author》--$_title\n君不见黄河之水天上来，奔流到海不复回。天生我材必有用，千金散尽还复来。",
      textAlign: TextAlign.center,
      textDirection: TextDirection.ltr,
      style: _testStyle,
      maxLines: 3,
      overflow: TextOverflow.ellipsis,
    );
  }
}
